package com.cmd.driver;


import com.alibaba.fastjson.JSONObject;
import com.player.DriverUser;
import com.player.User;
import com.qy.bean.DriverInfo;
import com.qy.util.StaticData;
import com.util.AbstractCommand;
import com.util.PBMessage;

/**
 * 
 * 获取司机信息
 * @author zwl
 * 2018年2月1日
 */
public class DriverInfoCMD  extends AbstractCommand{

	@Override
	public void execute(User user, PBMessage packet) throws Exception {
	    	JSONObject reJs = new JSONObject();
		
		DriverUser driverUser = (DriverUser) user;
		DriverInfo driverInfo = driverUser.getDriverInfo();
		reJs.put(StaticData.reKey.code.getKey(), StaticData.codeType.ok.getType());
		reJs.put("userName", driverInfo.getUserName());
		reJs.put("card", driverInfo.getCard());
		reJs.put("drivingLicenceImage1", driverInfo.getDrivingLicenceImage1());
		reJs.put("drivingLicenceImage2", driverInfo.getDrivingLicenceImage2());
		reJs.put("sex", driverInfo.getSex());
		reJs.put("headImage",driverInfo.getImage());
		reJs.put("phone", driverInfo.getPhone());
		reJs.put("status", driverInfo.getUserStatus());
		reJs.put(StaticData.reKey.code.getKey(), StaticData.codeType.ok.getType());
		reJs.put(StaticData.reKey.cmd.getKey(),packet.getCode());
		user.sendPacket(reJs);
		return;
	}

}
